﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using System.Data.Common;

namespace DBLibiary
{
    public interface IDBOperater
    {
        DBConnConfig A_DBConnConfig { get; set; }

        string A_ConnectionString { get; }

        DbConnection A_DbConnection { get; }

        DbTransaction A_DbTransaction { get; set; }

        void OpenConnection();

        void CloseConnection();

        void BeginTransaction();

        void CommitTransaction();

        void RollbackTransaction();

        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, int intParaSize);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, ParameterDirection Paradirect);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, int intParaSize, ParameterDirection Paradirect);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, int intPrecision, int intScale, ParameterDirection Paradirect);

        DataSet ExecuteSqlForDataSet(string strSQL);

        DataSet ExecuteSqlForDataSet(string strSQL, IDataParameter[] param);

        DataTable ExecuteSqlForDataTable(string strSQL);

        DataTable ExecuteSqlForDataTable(string strSQL, string dataTableName);

        DataTable ExecuteSqlForDataTable(string strSQL, IDataParameter[] param);

        DataTable ExecuteSqlForDataTable(string strSQL, string dataTableName, IDataParameter[] param);

        object ExecuteSqlScalarForObject(string sql);

        object ExecuteSqlScalarForObject(string sql, IDataParameter[] param);

        DataSet ExecuteProcForDataSet(string strSQL);

        DataSet ExecuteProcForDataSet(string strSQL, IDataParameter[] param);

        DataTable ExecuteProcForDataTable(string strSQL);

        DataTable ExecuteProcForDataTable(string strSQL, string dataTableName);

        DataTable ExecuteProcForDataTable(string strSQL, IDataParameter[] param);

        DataTable ExecuteProcForDataTable(string strSQL, string dataTableName, IDataParameter[] param);

        int ExecuteSqlNonQuery(string strSQL);

        int ExecuteSqlNonQuery(string strSQL, IDataParameter[] param);

        int ExecuteProcNonQuery(string strSQL);

        int ExecuteProcNonQuery(string strSQL, IDataParameter[] param);
    }
}
